<!--
 * @Author: WangLong
 * @Date: 2023-07-07 14:39:11
 * @LastEditTime: 2023-08-03 11:16:32
 * @LastEditors: WangLong
 * @Description: 
 * @FilePath: \jnks-drone-company\src\components\home\realTime.vue
-->
<!-- 实时告警 -->
<template>
  <div class="realTime-section">
    <Title title="实时告警">
      <el-select
        class="select"
        popper-class="confirmadd_el-select-dropdown"
        v-model="dataType"
        size="small"
        @change="switchChange">
        <el-option v-for="item in Options" :key="item.value" :label="item.name" :value="item.value">
        </el-option>
      </el-select>
    </Title>
    <slot name="real-time-slot" />
  </div>
</template>
<script setup>
  import { ref } from 'vue'
  import Title from '@/components/home/title.vue'
  const emits = defineEmits(['getRealTimeList'])
  let dataType = ref('all')
  let Options = [
    {
      name: '全部',
      value: 'all',
    },
    {
      name: '定位',
      value: 'direction',
    },
    {
      name: '测向',
      value: 'positioning',
    },
    {
      name: '解码',
      value: 'decoding',
    },
    {
      name: '民航',
      value: 'minghang',
    },
  ]
  /**
   * @description: 切换 实时侦测 无人机展示类型
   * @param {*} type
   */
  const switchChange = (type) => {
    emits('getRealTimeList', type)
    emits('histComdetect', type)
  }
  defineExpose({ dataType })
</script>
<style lang="scss" scoped>
  .realTime-section {
    width: 100%;
    height: 54%;
    .historyclass {
      display: inline-block;
      width: 78px;
      padding: 0 1%;
      font-size: 12px;
      font-weight: bold;
      color: #ffffff;
      line-height: 20px;
      border: 1px #a7d6ff solid;
      border-radius: 5px;
      /* border-image: linear-gradient(0deg, #a7d6ff, #ffffff) 1 1;
        clip-path: inset(0 round 2px); */
      vertical-align: middle;
      cursor: pointer;
      position: absolute;
      right: 2%;
      color: #a9c9e3;
      background: linear-gradient(180deg, #133043 0%, #0c5b93 100%);
      /* -webkit-background-clip: text; */
      /* -webkit-text-fill-color: transparent; */

      .right-icon {
        display: inline-block;
        width: 15px;
        height: 15px;
        background: url('/img/history.png') no-repeat;
        background-size: 100% 100%;
        vertical-align: middle;
        cursor: pointer;
        margin: 0 5px 3px 3px;
      }
    }
    .select {
      position: absolute;
      width: 80px;
      right: 5px;
    }
  }
  :deep(.el-select .el-input__wrapper, .el-input__wrapper) {
    background-color: rgba(35, 62, 92, 1);
    color: #fff;
    border: 1px solid #2daef1;
    box-shadow: none;
  }
  :deep(.el-select .el-input__inner) {
    color: #ffffff;
  }
  :deep(.el-select-dropdown__item.is-hovering) {
    background-color: transparent !important;
  }
  :deep(.el-select__placeholder) {
    color: #ffffff;
  }
</style>
